package com.simon.seckill.constant;

/**
 * 公共常量
 * */
public class CommonConstant {
    public interface RedisKey {
        String GOODS_STORE_BY_ID = "GOODS_STORE_BY_GOODS_IDS:{0}";

        String GOODS_INFO_BY_ID = "GOODS_INFO_BY_GOODS_IDS:{0}";

        String SECKILL_FINISH_FLAG = "SECKILL_FINISH_FLAG:{0}";

        /**
         *  秒杀处理列表
         * */
        String SECKILL_HANDLE_LIST = "SECKILL_HANDLE_LIST_GOOD_RANDOM_NAME:{0}";

        /**
         * 黑名单列表
         * */
        String USER_BLACK_LIST = "USER_BLACK_LIST";

        String IP_BLACK_LIST = "IP_BLACK_LIST";

        /**
         * redis库存
         * */
        String REDIS_GOODS_STORE = "REDIS_GOODS_STORE_RANDOM_NAME:{0}";

        String SECKILL_SUCCESS_TOKEN = "SECKILL_SUCCESS_TOKEN_PHONE:{0}_GOOD_RANDOM_NAME:{1}_";

        String USER_REQUEST_TIMES= "user_request_times:{0}";

        String IP_REQUEST_TIMES = "ip_request_times:{0}";
    }

    public interface RedisKeyExpireSeconds {
        int GOODS_STORE_BY_ID = 3 * 24 * 60 * 60;
    }

    public interface CurrentLimitMultiple {

        // 商品购买限流倍数
        int GOODS_BUY=1;
    }

    public interface MessageType {
        String SECKILL_MESSAGE = "SECKILL_MESSAGE";
    }

    /**
     * 下单token有效期，单位：毫秒
     * */
    public static final long TOKEN_EFECTIVE_MILLISECONDS = 3*60*1000;
}
